﻿<Application x:Class="Newgen.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             ShutdownMode="OnMainWindowClose"
             Startup="ApplicationStartup" Exit="ApplicationExit" DispatcherUnhandledException="ApplicationDispatcherUnhandledException">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Newgen.Base;component/Resources/TabControlGlass.xaml"/>
                <ResourceDictionary Source="/Newgen.Base;component/Resources/Colors.xaml"/>
                <ResourceDictionary Source="/Newgen.Base;component/Resources/MetroCheckBox.xaml"/>
                <ResourceDictionary Source="/Newgen.Base;component/Resources/MetroComboBox.xaml"/>
                <ResourceDictionary Source="/Newgen.Base;component/Resources/MetroRadioButton.xaml"/>
                <ResourceDictionary Source="/Newgen.Base;component/Resources/MetroTextBox.xaml"/>
                <ResourceDictionary Source="/Newgen.Base;component/Resources/MetroButton.xaml"/>
                <ResourceDictionary Source="Themes/Generic.xaml"/>
                <ResourceDictionary>
                    <!-- Simple TextBox -->
                    <Style x:Key="SimpleTextBox" TargetType="{x:Type TextBox}">
                        <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
                        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                        <Setter Property="AllowDrop" Value="true"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type TextBox}">
                                    <Grid>
                                        <Border x:Name="Border" Background="{DynamicResource WindowBackgroundBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1" Padding="2" CornerRadius="7">
                                            <!-- The implementation places the Content into the ScrollViewer. It must be named PART_ContentHost for the control to function -->
                                            <ScrollViewer Margin="0" x:Name="PART_ContentHost" Style="{DynamicResource SimpleScrollViewer}" Background="{TemplateBinding Background}"/>
                                        </Border>
                                    </Grid>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsEnabled" Value="False">
                                            <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
                                            <Setter Property="BorderBrush" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border"/>
                                            <Setter Property="Foreground" Value="{DynamicResource DisabledForegroundBrush}"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>